package com.lhb.common.utils;

import com.lhb.pojo.entity.Student;
import com.lhb.pojo.vo.AwardVo;
import com.lhb.pojo.vo.CourseVo;
import com.lhb.pojo.vo.FamilyVo;

import java.util.List;



public class ListUtils {

    public static String[][] ListToTwoArrayStudent(List<Student> list, int colNum) {

        int i=0,rowNum=list.size();



        String[][] d = new String[rowNum][colNum];

        for (Student student : list) {

            d[i][0]=student.getGrade();
            d[i][1]=student.getProfession();
            d[i][2]=student.getMyClass();
            d[i][3]= student.getStudentId();
            d[i][4]=student.getStudentName();
            d[i][5]=student.getSex();
            d[i][6]= String.valueOf(student.getAge());
            d[i][7]= String.valueOf(student.getBirthday());
            d[i][8]=student.getMyNative();
            d[i][9]=student.getAddress();
            d[i][10]= String.valueOf(student.getPrivilegeStatus());
            d[i][11]=student.getPhone();
            i++;

        }


    return d;

    }




    public static String[][] ListToTwoArrayFamily(List<FamilyVo> list, int colNum) {

        int i=0,rowNum=list.size();



        String[][] d = new String[rowNum][colNum];

        for (FamilyVo familyVo : list) {

            d[i][0]= familyVo.getGrade();
            d[i][1]= familyVo.getProfession();
            d[i][2]= familyVo.getMyClass();
            d[i][3]= familyVo.getStudentId();
            d[i][4]= familyVo.getStudentName();
            d[i][5]= familyVo.getSex();
            d[i][6]= familyVo.getTitle();
            d[i][7]= familyVo.getFamilyName();
            d[i][8]= familyVo.getWorkPlace();
            d[i][9]= familyVo.getBusiness();
            d[i][10]= familyVo.getPhone();
            i++;
        }


        return d;

    }



    public static String[][] ListToTwoArrayAward(List<AwardVo> list, int colNum) {

        int i=0,rowNum=list.size();



        String[][] d = new String[rowNum][colNum];

        for (AwardVo awardVo : list) {

            d[i][0]= awardVo.getGrade();
            d[i][1]= awardVo.getProfession();
            d[i][2]= awardVo.getMyClass();
            d[i][3]= awardVo.getStudentId();
            d[i][4]= awardVo.getStudentName();
            d[i][5]= awardVo.getSex();
            d[i][6]= awardVo.getPrizeName();
            d[i][7]= awardVo.getPrize();
            d[i][8]= awardVo.getAwardTime();
            i++;
        }


        return d;

    }

    public static String[][] ListToTwoArrayCourse(List<CourseVo> list, int colNum) {

        int i=0,rowNum=list.size();



        String[][] d = new String[rowNum][colNum];

        for (CourseVo courseVo : list) {

            d[i][0]= courseVo.getGrade();
            d[i][1]= courseVo.getProfession();
            d[i][2]= courseVo.getMyClass();
            d[i][3]= courseVo.getStudentId();
            d[i][4]= courseVo.getStudentName();
            d[i][5]= courseVo.getSex();
            d[i][6]= courseVo.getCourse();
            d[i][7]= courseVo.getScore();
            i++;
        }


        return d;

    }




}
